package com.example.viewpageapplication;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

import com.example.viewpageapplication.adapter.RecycleVAdapter;
import com.example.viewpageapplication.entity.BaseT;

import java.util.List;

public class RecyclerViewMainActivity extends AppCompatActivity {

    private List<BaseT> baseTS;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recycler_view_main);

        RecyclerView recyclerView = findViewById(R.id.rlv_recycle);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));

        baseTS = BaseT.getDefalutList();

        RecycleVAdapter recycleVAdapter = new RecycleVAdapter(this,baseTS);
        recyclerView.setAdapter(recycleVAdapter);
        recyclerView.addItemDecoration(new DividerItemDecoration(this,DividerItemDecoration.VERTICAL));
        recyclerView.setItemAnimator(new DefaultItemAnimator());
        }



    }
